# -*- coding: utf-8 -*-
import unittest

from crm.base.crm_use_browser import UseBrowser
from crm.webpage.customerassign.customerssign_page import CustomerAssignPage
from crm.webpage.login_page import LoginPage


class TestCustomerAssignAll(unittest.TestCase):

    # 前置条件
    def setUp(self) -> None:
        self.lp = LoginPage()
        self.lp.login(self.lp.exl.get_cell(1, 2), self.lp.exl.get_cell(1, 3))
        self.cap = CustomerAssignPage()

    # 客户分配，全选,判断全选是否选中
    def test_customerassign_2_all(self):
        # 进入客户分配
        self.cap.customer_assign()
        self.cap.customer_assign_all()
        # 判断返回是不是True
        self.assertTrue(self.cap.get_customer_assign_all(int(self.cap.exl.get_cell(2,5)),int(self.cap.exl.get_cell(2,6))))


    def tearDown(self) -> None:
        UseBrowser.driver.quit()

if __name__ == '__main__':
    unittest.main()